import request from '@/utils/request'

const baseUrl = '/spoken/qa'

// 查询首页问答列表
export function listHomeQa(query) {
  return request({
    url: baseUrl +'/list',
    method: 'get',
    params: query
  })
}

// 查询首页问答详细
export function getHomeQa(qaId) {
  return request({
    url: baseUrl + '/' + qaId,
    method: 'get'
  })
}

// 新增问答内容
export function addHomeQa(data) {
  return request({
    url: baseUrl,
    method: 'post',
    data: data
  })
}

// 修改问答内容
export function updateHomeQa(data) {
  return request({
    url: baseUrl,
    method: 'put',
    data: data
  })
}

// 删除问答内容
export function deleteHomeQa(qaId) {
  return request({
    url: baseUrl + '/' + qaId,
    method: 'delete',
  })
}
